package stegosaur.ext;

import stegosaur.volume.VolumeParameters;
import stegosaur.volume.VolumeParametersException;

/**
 * <p>
 * Stegosaur application authors can use this interface to perform
 * validation on volume parameters at the time of new volume creation.
 * This is useful if you wish to impose application-specific limits
 * on any parameter, say by limiting the block size to a certain
 * range or insisting upon a certain policy for item redundancy.
 * </p>
 * <p>
 * Note that this validation is done in addition to Stegosaur's
 * own validation, not instead of.  Stegosaur.Volume imposes its
 * own restrictions that cannot be overridden here.  Those restrictions
 * are:
 * <ul>
 * <li>Volume name cannot be null or empty
 * <li>Specified volume master file must not exist
 * <li>Split file name formula must be syntactically correct
 * <li>Split file size cannot be negative
 * <li>Block size must be a multiple of 4KB between 4KB and 512KB
 * <li>preferSequential must be one of the SEQUENTIAL_ constants in VolumeParameters
 * <li>preferRedundant must be one of the REDUNDANT_ constants in VolumeParameters
 * </ul>
 * </p>
 * <p>
 * To fail validation, simply throw a VolumeParametersException
 * from the validate method.  If no exception is thrown then 
 * validation is assumed to have completed successfully.
 * </p>
 *
 * @see stegosaur.volume.Volume, stegosaur.volume.VolumeParameters
 * @author gndn.k5
 * @since Stegosaur 1.0
 */
public interface VolumeParametersValidator
{
  public void validate(VolumeParameters params) throws VolumeParametersException;
}
